package org.gdpu.model;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * 组别
 */

@Entity
public class Teams {
    /**
     组别名称
     */
    private String teamName;
    /**
     组别用户
    */
    private Set<Person> persons = new HashSet<Person>(0);
    /**
     * 公告
     */
    private String notice;
    /**
     * 组别创建者
     */
    private String owner;

    public Teams(String teamName) {
        this.teamName = teamName;
    }

    public Teams() {
    }

    @Id
    @Column(name = "teamName", unique = true, nullable = false, length = 60)
    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "teams")
    public Set<Person> getPersons() {
        return persons;
    }

    public void setPersons(Set<Person> persons) {
        this.persons = persons;
    }

    public String getNotice() {
        return notice;
    }

    public void setNotice(String notice) {
        this.notice = notice;
    }

    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }
}
